Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for filtering on region #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kadaan
Copy link
Contributor

@kadaan kadaan commented Sep 3, 2019

Add support for filtering on region so that I can have one config file that can work across multiple regions.

@jckuester
Copy link
Owner

Not sure if something is missing here. I think also the initAwsProvider(*profile, *region, *maxRetries) has to be also specifically initialized for the region one wants to work with (https://github.com/cloudetc/awsweeper/pull/50/files#diff-c4de833e2982802ae3a842e94963b5c7R69).

We probably need to add an integration test for this too, so that we can the issue I mentioned. I can provide a test if I find time

@kadaan
Copy link
Contributor Author

kadaan commented Sep 13, 2019

This is simply about exposing the region specified on the cli as part of the resources, so that it can be filtered on. This allows me to write a config that I can use in different regions and will perform differently.

@kadaan
Copy link
Contributor Author

kadaan commented Jun 25, 2022

@jckuester This should be resurrected. The whole concept of this still works in the re-write you have done. It enables you to write a cleanup specification like:

aws_instance:
  - region: NOT(us-east-1)
    tags:
      Name: my-server-\d+-.+
    created:
      before: 1h
  - region: us-east-1
    tags:
      Name: my-server-0[^1]-.+
    created:
      before: 1h

@jckuester
Copy link
Owner

jckuester commented Jul 11, 2022

@kadaan I picked the code from your branches (hope that is OK) and added some tests: #137. Lets get the region filter feature merged first and the let's focus on the optimisation for discovery that you provided in a second step.

@kadaan
Copy link
Contributor Author

kadaan commented Jul 11, 2022

@jckuester Sounds great! I'd love to know if the perf improvements seem good to you. For me they were a really big help when trying to cleanup resources in 13+ regions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants